<?php
  require_once ('../connect.php');
    $sql="select * from article order by dateline desc";
    $query=mysql_query($sql);
    if(mysql_num_rows($query)){
        while ($row=mysql_fetch_assoc($query)){
            
            $data[]=$row;
        }
        
    }
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
a{ }
.aaa{ width:1000px; margin: 0 auto; height:500px;}
.top{ width:100%; background:#FFC; height:100px; border-bottom:#333 solid 1px; text-align:center; line-height:100px;}
.left{ height:400px; width:199px; background:#FFC; float:left; border-right:#333 solid 1px;}
.right{ height:400px; width:800px; float:left; background:#CFF;}
.top h2{ font-size:30px; text-align:center; line-height:100px;}
.list{ margin-top:20px ; }
.list ul{ list-style:none;}
.list ul li{ line-height:50px; }
td{ height:30px; text-align:center;}
</style>
</head>

<body>

<div class="aaa">
	<!--/*头部*/-->
	<div class="top"><span style="font-size:40px;">后台管理系统</span>  <span><a href="../article.list.php">首页</a></span></div>
    
    <!--中间-->
    <div>
    	<div class="left">
        	<div class="list">
            	<ul>
                	<li><a href="article.add.php">发布文章</a></li>
                   
                </ul>
            </div>
        </div>
        <div class="right" >
        <form name="form1" method="post" action="article.add.handle.php">
            <table width="574" border="1" style="margin: 20px auto;">
              <tr>
                <td colspan="3">文章管理列表</td>
              </tr>
              <tr>
                <td width="97">编号</td>
                <td width="278">标题</td>
                <td width="177">操作</td>
              </tr>
     <?php         
          foreach($data as $value){
			 ?>
              <tr>
                <td><?php echo $value['id'] ?></td>
                <td><?php echo $value['title'] ?></td>
                <td><a href="article.del.handle.php?id=<?php  echo $value['id'] ?>"> 删除</a> &nbsp;
                
                <a href="article.modify.php?id=<?php  echo $value['id'] ?>">修改</a></td>
              </tr> 
              <?php
              }   
			  ?>          
            </table>
            </form>
        </div>
    </div>
    
    <!--下部-->
    <div></div>
</div>

</body>
</html>